<?php
class Application_Model_News{
	protected $_id;
	protected $_title;
	protected $_author;
	protected $_date;
	protected $_text;
	protected $_pseudo;
	
	public function __construct(){
		
	}
	
	public function __set($name, $value){
		$method = 'set'.$name;
		if(($name == 'mapper') || !method_exists($this, $method)){
			throw new Exception('Invalid news property');
		}
		$this->$method($value);
	}
	public function __get($name){
		$method = 'get'.$name;
		if(($name=='mapper')||!method_exists($this, $method)){
			throw new Exception('Invalid news property');
		}
		return $this->$method();
	}
	public function setTitle($title){
		$this->_title = (string) $title;
		return $this;
	}
	public function getTitle(){
		return $this->_title;
	}
	public function setAuthor($author){
		$this->_author=(int) $author;
		return $this;
	}
	public function getAuthor(){
		return $this->_author;
	}
	public function setDate($date){
		$this->_date =  new Zend_Date($date,Zend_Date::ISO_8601);
		return $this;
	}
	public function getDate(){
		return $this->_date;
	}
	public function setText($text){
		$this->_text = (string) $text;
		return $this;
	}
	public function getText(){
		return $this->_text;
	}
	public function setId($id){
		$this->_id = (int) $id;
		return $this;
	}
	public function getId(){
		return $this->_id;
	}
	public function setPseudo($p){
		$this->_pseudo= $p;
		return $this;
	}
	public function getPseudo(){
		return $this->_pseudo;
	}
}